Optimal. Leaf size=251 \[ -\frac {\sqrt {\frac {\pi }{2}} \sin \left (a+\frac {b^2}{4 c}\right ) C\left (\frac {b-2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}-\frac {\sqrt {\frac {\pi }{2}} b^2 \cos \left (a+\frac {b^2}{4 c}\right ) C\left (\frac {b-2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{4 c^{5/2}}-\frac {\sqrt {\frac {\pi }{2}} b^2 \sin \left (a+\frac {b^2}{4 c}\right ) S\left (\frac {b-2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{4 c^{5/2}}+\frac {\sqrt {\frac {\pi }{2}} \cos \left (a+\frac {b^2}{4 c}\right ) S\left (\frac {b-2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}-\frac {b \sin \left (a+b x-c x^2\right )}{4 c^2}-\frac {x \sin \left (a+b x-c x^2\right )}{2 c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.22, antiderivative size = 251, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {3464, 3447, 3351, 3352, 3462, 3448} \[ -\frac {\sqrt {\frac {\pi }{2}} \sin \left (a+\frac {b^2}{4 c}\right ) \text {FresnelC}\left (\frac {b-2 c x}{\sqrt {2 \pi } \sqrt {c}}\right )}{2 c^{3/2}}-\frac {\sqrt {\frac {\pi }{2}} b^2 \cos \left (a+\frac {b^2}{4 c}\right ) \text {FresnelC}\left (\frac {b-2 c x}{\sqrt {2 \pi } \sqrt {c}}\right )}{4 c^{5/2}}-\frac {\sqrt {\frac {\pi }{2}} b^2 \sin \left (a+\frac {b^2}{4 c}\right ) S\left (\frac {b-2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{4 c^{5/2}}+\frac {\sqrt {\frac {\pi }{2}} \cos \left (a+\frac {b^2}{4 c}\right ) S\left (\frac {b-2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}-\frac {b \sin \left (a+b x-c x^2\right )}{4 c^2}-\frac {x \sin \left (a+b x-c x^2\right )}{2 c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3351
Rule 3352
Rule 3447
Rule 3448
Rule 3462
Rule 3464
Rubi steps
\begin {align*} \int x^2 \cos \left (a+b x-c x^2\right ) \, dx &=-\frac {x \sin \left (a+b x-c x^2\right )}{2 c}+\frac {\int \sin \left (a+b x-c x^2\right ) \, dx}{2 c}+\frac {b \int x \cos \left (a+b x-c x^2\right ) \, dx}{2 c}\\ &=-\frac {b \sin \left (a+b x-c x^2\right )}{4 c^2}-\frac {x \sin \left (a+b x-c x^2\right )}{2 c}+\frac {b^2 \int \cos \left (a+b x-c x^2\right ) \, dx}{4 c^2}-\frac {\cos \left (a+\frac {b^2}{4 c}\right ) \int \sin \left (\frac {(b-2 c x)^2}{4 c}\right ) \, dx}{2 c}+\frac {\sin \left (a+\frac {b^2}{4 c}\right ) \int \cos \left (\frac {(b-2 c x)^2}{4 c}\right ) \, dx}{2 c}\\ &=\frac {\sqrt {\frac {\pi }{2}} \cos \left (a+\frac {b^2}{4 c}\right ) S\left (\frac {b-2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}-\frac {\sqrt {\frac {\pi }{2}} C\left (\frac {b-2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a+\frac {b^2}{4 c}\right )}{2 c^{3/2}}-\frac {b \sin \left (a+b x-c x^2\right )}{4 c^2}-\frac {x \sin \left (a+b x-c x^2\right )}{2 c}+\frac {\left (b^2 \cos \left (a+\frac {b^2}{4 c}\right )\right ) \int \cos \left (\frac {(b-2 c x)^2}{4 c}\right ) \, dx}{4 c^2}+\frac {\left (b^2 \sin \left (a+\frac {b^2}{4 c}\right )\right ) \int \sin \left (\frac {(b-2 c x)^2}{4 c}\right ) \, dx}{4 c^2}\\ &=-\frac {b^2 \sqrt {\frac {\pi }{2}} \cos \left (a+\frac {b^2}{4 c}\right ) C\left (\frac {b-2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{4 c^{5/2}}+\frac {\sqrt {\frac {\pi }{2}} \cos \left (a+\frac {b^2}{4 c}\right ) S\left (\frac {b-2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}-\frac {\sqrt {\frac {\pi }{2}} C\left (\frac {b-2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a+\frac {b^2}{4 c}\right )}{2 c^{3/2}}-\frac {b^2 \sqrt {\frac {\pi }{2}} S\left (\frac {b-2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a+\frac {b^2}{4 c}\right )}{4 c^{5/2}}-\frac {b \sin \left (a+b x-c x^2\right )}{4 c^2}-\frac {x \sin \left (a+b x-c x^2\right )}{2 c}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.71, size = 164, normalized size = 0.65 \[ \frac {\sqrt {2 \pi } C\left (\frac {2 c x-b}{\sqrt {c} \sqrt {2 \pi }}\right ) \left (2 c \sin \left (a+\frac {b^2}{4 c}\right )+b^2 \cos \left (a+\frac {b^2}{4 c}\right )\right )-\sqrt {2 \pi } S\left (\frac {2 c x-b}{\sqrt {c} \sqrt {2 \pi }}\right ) \left (2 c \cos \left (a+\frac {b^2}{4 c}\right )-b^2 \sin \left (a+\frac {b^2}{4 c}\right )\right )-2 \sqrt {c} (b+2 c x) \sin (a+x (b-c x))}{8 c^{5/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.32, size = 178, normalized size = 0.71 \[ \frac {\sqrt {2} {\left (\pi b^{2} \cos \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) + 2 \, \pi c \sin \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {C}\left (\frac {\sqrt {2} {\left (2 \, c x - b\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right ) + \sqrt {2} {\left (\pi b^{2} \sin \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) - 2 \, \pi c \cos \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {S}\left (\frac {\sqrt {2} {\left (2 \, c x - b\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right ) + 2 \, {\left (2 \, c^{2} x + b c\right )} \sin \left (c x^{2} - b x - a\right )}{8 \, c^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [C] time = 0.51, size = 227, normalized size = 0.90 \[ -\frac {\frac {\sqrt {2} \sqrt {\pi } {\left (b^{2} + 2 i \, c\right )} \operatorname {erf}\left (-\frac {1}{4} \, \sqrt {2} {\left (2 \, x - \frac {b}{c}\right )} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}\right ) e^{\left (-\frac {i \, b^{2} + 4 i \, a c}{4 \, c}\right )}}{{\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}} - 2 \, {\left (c {\left (-2 i \, x + \frac {i \, b}{c}\right )} - 2 i \, b\right )} e^{\left (i \, c x^{2} - i \, b x - i \, a\right )}}{16 \, c^{2}} - \frac {\frac {\sqrt {2} \sqrt {\pi } {\left (b^{2} - 2 i \, c\right )} \operatorname {erf}\left (-\frac {1}{4} \, \sqrt {2} {\left (2 \, x - \frac {b}{c}\right )} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}\right ) e^{\left (-\frac {-i \, b^{2} - 4 i \, a c}{4 \, c}\right )}}{{\left (\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}} - 2 \, {\left (c {\left (2 i \, x - \frac {i \, b}{c}\right )} + 2 i \, b\right )} e^{\left (-i \, c x^{2} + i \, b x + i \, a\right )}}{16 \, c^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 202, normalized size = 0.80 \[ -\frac {x \sin \left (-c \,x^{2}+b x +a \right )}{2 c}+\frac {b \left (-\frac {\sin \left (-c \,x^{2}+b x +a \right )}{2 c}+\frac {b \sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (\frac {\frac {b^{2}}{4}+c a}{c}\right ) \FresnelC \left (\frac {\sqrt {2}\, \left (c x -\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )+\sin \left (\frac {\frac {b^{2}}{4}+c a}{c}\right ) \mathrm {S}\left (\frac {\sqrt {2}\, \left (c x -\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )\right )}{4 c^{\frac {3}{2}}}\right )}{2 c}-\frac {\sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (\frac {\frac {b^{2}}{4}+c a}{c}\right ) \mathrm {S}\left (\frac {\sqrt {2}\, \left (c x -\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )-\sin \left (\frac {\frac {b^{2}}{4}+c a}{c}\right ) \FresnelC \left (\frac {\sqrt {2}\, \left (c x -\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )\right )}{4 c^{\frac {3}{2}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [C] time = 4.55, size = 1556, normalized size = 6.20 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int x^2\,\cos \left (-c\,x^2+b\,x+a\right ) \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x^{2} \cos {\left (a + b x - c x^{2} \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________